package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.UnitDao;
import com.atguigu.jxc.entity.Unit;
import com.atguigu.jxc.service.UnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lfh
 * @version 1.0
 * @date 2021/5/14 23:11
 */
@Service
public class UnitServiceImpl implements UnitService {

    @Autowired
    private UnitDao unitDao;

    @Override
    public Map<String, Object> list() {
        HashMap<String, Object> map = new HashMap<>();
        List<Unit> unitList = unitDao.list();
        /*for (Unit unit : unitList) {
//            map.put("unitId", unit.getUnitId());
//            map.put("unitName", unit.getUnitName());
        }*/
        map.put("rows", unitList);
        return map;
    }
}
